// 和 history 相关的类型

import type { HistoryState } from 'vue-router'

export type HistoryLocation = string

export interface NavigationCallback {
  (to: HistoryLocation, from: HistoryLocation): void
}

export interface RouterHistory {
  readonly location: {
    value: string
  }
  push(to: HistoryLocation, data?: HistoryState): void
  repalce(to: HistoryLocation, data?: HistoryState): void
  readonly state: HistoryState
  listen(callback: NavigationCallback): void
}
